﻿<Grid Padding="new Thickness(10)" RowDefinitions="Auto, Auto" ColumnDefinitions="Auto, *">
    <TapGestureRecognizer OnTapped="Details"/>
    <GridCell RowSpan="2">
        <Image Source="new UriImageSource { Uri=new Uri(Animal.ImageUrl) }"
               Aspect="Aspect.AspectFill"
               HeightRequest="60"
               WidthRequest="60" />
    </GridCell>

    <GridCell Column="1">
        <Label Text="@Animal.Name"
               FontAttributes="FontAttributes.Bold" />
    </GridCell>

    <GridCell Row="1" Column="1">
        <Label Text="@Animal.Location"
               FontAttributes="FontAttributes.Italic"
               VerticalOptions="LayoutOptions.End" />
    </GridCell>
</Grid>


@code
{
    [Parameter] public Animal Animal { get; set; }
    [Parameter] public EventCallback<Animal> OnClick {get; set; }
    void Details()
    {
        if(OnClick.HasDelegate)
            OnClick.InvokeAsync(Animal);
    }
}
